package eop.project

class VolcanoController {
	
	def scaffold = true
	def volcanoXmlService
	
	def search = { //searchable
		render Volcano.search(params.q, params)
	}
	
	def index = {
	}
		
	def volcanoQuery = {		
		def resultList
		if(params.name){
			resultList = Volcano.findAllByVolcanoName(params.name)
		}
		else if (params.type){
			resultList = Volcano.findAllByVolcanoType(params.type)
		}
		else if (params.status){
			resultList = Volcano.findAllByStatus(params.status)
		}
		else if (params.id){
			resultList = Volcano.findAllByVolcanicRef(params.id)
		}
		else if (params.all){
			resultList = Volcano.list()	//a list of all proteins
		}
		
		return [results:resultList] //is return needed?
	}
}
